INCLUDE(CMakeModules/CPM.cmake)

CPMAddPackage(
        NAME googletest
        GITHUB_REPOSITORY google/googletest
        GIT_TAG release-1.8.1
        VERSION 1.8.1
        OPTIONS
        "INSTALL_GTEST OFF"
        "gtest_force_shared_crt ON"
)

ADD_EXECUTABLE(Httplib.Test.Main test.cc)
TARGET_LINK_LIBRARIES(Httplib.Test.Main PRIVATE gtest)
TARGET_LINK_LIBRARIES(Httplib.Test.Main PRIVATE Httplib)
ADD_TEST(NAME Httplib.Test.Main COMMAND Httplib.Test.Main)

FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/www DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/www2 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/www3 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/image.jpg DESTINATION ${CMAKE_CURRENT_BINARY_DIR})